Module Map Icons

Tuple Documentation of module_map_icons.py
Each map icon record contains the following fields:
1) Map icon id: used for referencing map icons in other files.
    The prefix icon_ is automatically added before each map icon id.
2) Map icon flags. See header_map icons.py for a list of available flags
3) Mesh name, for Native they can be found in the brf files map_icon_meshes, map_icons_b, and map_icons_c
4) Scale.
5) Sound.
6) Offset x position for the flag icon.
7) Offset y position for the flag icon.
8) Offset z position for the flag icon.

module_map_icons.py begins with two constants that are used to govern the scale of the map 'avatars' and banners which we see in-game.

								
									banner_scale = 0.3
avatar_scale = 0.15

They are pretty much self-explanatory. Editing the value at banner_scale rescales the size of the banners and the value at avatar_scale accordingly the size of the 'avatars' at the world map. You will see those constants getting used at the entries of the map icons, to avoid making accidentally some misstake at copy pasting the numbers. You are free to add new constants there, fitting to your purposes. Hereinafter you will find the following lines:

								
									map_icons = [
("player", 0, "player", avatar_scale, snd_footstep_grass, 0.15, 0.173, 0),
("player_horseman", 0, "player_horseman", avatar_scale, snd_gallop, 0.15, 0.173, 0),
("gray_knight", 0, "knight_a", avatar_scale, snd_gallop, 0.15, 0.173, 0),
("vaegir_knight", 0, "knight_b", avatar_scale, snd_gallop, 0.15, 0.173, 0),
...

Taking again the first tuple ("player",0,"player", avatar_scale, snd_footstep_grass, 0.15, 0.173, 0), as example of observation:

								
									1) name of the icon = "player"
2) icon flags = 0
3) Mesh name = "player"
4) Mesh scale = avatar_scale
5) sound id = snd_footstep_grass
6) Flag offset x = 0.15
7) Flag offset y = 0.173
6) Flag offset z = 0

The player icon has no icon flag and is using the mesh "player" as visual. The mesh is scaled down to the constant avatar_scale which has been defined before as 15 percent. While the icon is moving on the world map the sound footstep_grass is getting played.

Take note that sounds entered in tuple field 5) need to be set up in module_sounds.py too. Be also aware that multi-meshing is not possible for map icons. You can however have multiple static parties in one location (like bridges), with only one of them being e.g. the city itself.[1]

There is a limit of 256 map icons hardcoded into the game engine. Most modders get around this by condensing the hundreds of flag icons into heraldic ones.[2] While the limit of 256 map icons is getting applied by the operation party_set_icon too, modders who seek an 256+ range can also make use of the operations party_set_banner_icon and party_set_extra_icon which are also working for 256+ map icons.[3]

Map Icon Flags

  • mcn_no_shadow prevents that the respective map icon casts a shadow.

Map Icon Triggers

  • ti_on_init_map_icon will run if a map icon is initialized. Trigger Parameter 1 is the ID of the Party whose map icon was just initialized.